﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Contracts.Entities
{
    public class MovieItem : MovieBaseItem
    {
        public int Id { get; set; }

        public string Name { get; set; }        
        
        public string OriginalName { get; set; }

        public Int16 ReleaseYear { get; set; }

        public Int16 RuntimeMin { get; set; }

        public Int16 FskAge { get; set; }

        public string Quality { get; set; }

        public string Overview { get; set; }

        public double Rating { get; set; }

        public double? TmdbRating { get; set; }

        public byte[] Cover { get; set; }
      
        public string FolderPath { get; set; }

        public string Revenue { get; set; }

        public string Budget { get; set; }

        public string TrailerUrl { get; set; }

        public IEnumerable<MovieElement> Genres { get; set; }

        public IEnumerable<MovieElement> Actors { get; set; }

        public IEnumerable<MovieElement> Directors { get; set; }

        public IEnumerable<MovieElement> Studios { get; set; }

        public IEnumerable<MovieElement> Countries { get; set; }

        public IEnumerable<byte[]> Backdrops { get; set; }

        public bool Watched { get; set; }

        public bool InfosComplete
        {
            get
            {
                return
                    !String.IsNullOrEmpty(OriginalName)
                    && ReleaseYear != 0
                    && RuntimeMin != 0
                    && !String.IsNullOrEmpty(Overview)
                    && Cover != new byte[] { }
                    && !String.IsNullOrEmpty(Revenue)
                    && !String.IsNullOrEmpty(Budget)
                    && !String.IsNullOrEmpty(TrailerUrl)
                    && Genres.Count() != 0
                    && Actors.Count() != 0
                    && Directors.Count() != 0
                    && Studios.Count() != 0
                    && Countries.Count() != 0
                    && Backdrops.Count() != 0;
            }
        }

    }
}
